package Practice.P01;

import java.util.*;

public class Practice04 {
    public static void main(String[] args) {
        // 集合嵌套 省份里面装城市
        // 格式化输出
        HashMap<String, ArrayList<String>> hm = new HashMap<>();
        ArrayList<String> g1 = new ArrayList<>();
        g1.add("大");
        g1.add("水");
        g1.add("长");
        g1.add("翘");
        ArrayList<String> g2 = new ArrayList<>();
        g2.add("大");
        g2.add("白");
        g2.add("美");
        g2.add("翘");

        hm.put("小平",g1);
        hm.put("小同",g2);
        Set<Map.Entry<String, ArrayList<String>>> entries = hm.entrySet();
        for (Map.Entry<String, ArrayList<String>> entry : entries) {
            String key = entry.getKey();
            ArrayList<String> value = entry.getValue();
            StringBuilder sb = new StringBuilder();
            for (String s : value) {
                sb.append(s);
            }
            System.out.println(key+"="+sb);
        }

    }
}
